-- GENERATED SPELL FOR [Grillok Darkeye] --


function spell0_19457(pUnit, Event) --@Chain Lightning,n/a--
pUnit:FullCastSpellOnTarget(12058,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_19457', 3000, 1)
end

function spell1_19457(pUnit, Event) --@Fire Nova Totem,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(32062,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_19457', 1, 1)
end

function spell2_19457(pUnit, Event) --@Grounding Totem,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(34079,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_19457', 1, 1)
end

function spell3_19457(pUnit, Event) --@Lightning Shield,n/a--
pUnit:FullCastSpellOnTarget(12550,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_19457', 0, 1)
end

function Sorts_19457(pUnit, Event)
local choix_sorts_19457 = math.random(0, 3)
if choix_sorts_19457 == 0 then
pUnit:RegisterEvent('spell0_19457', 1, 1)
end
if choix_sorts_19457 == 1 then
pUnit:RegisterEvent('spell1_19457', 1, 1)
end
if choix_sorts_19457 == 2 then
pUnit:RegisterEvent('spell2_19457', 1, 1)
end
if choix_sorts_19457 == 3 then
pUnit:RegisterEvent('spell3_19457', 1, 1)
end
end

function mob19457_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_19457', math.random(1500, 3000), 1)
end

function mob19457_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob19457_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob19457_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(19457, 1, 'mob19457_Action')
RegisterUnitEvent(19457, 2, 'mob19457_Leave')
RegisterUnitEvent(19457, 3, 'mob19457_Kill')
RegisterUnitEvent(19457, 4, 'mob19457_Die')
